<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>命令行接口 | 赵小云学习笔记</title>
    <meta name="generator" content="VuePress 1.8.0">
    <link rel="icon" href="/logo.png">
    <link rel="manifest" href="/manifest.json">
    <link rel="apple-touch-icon" href="/icons/apple-touch-icon-152x152.png">
    <link rel="mask-icon" href="/icons/safari-pinned-tab.svg" color="#3eaf7c">
    <script data-ad-client="ca-pub-2245427233262012" async="true" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <meta name="description" content="愿半生编码，如一生好友。">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
    <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/assets/css/0.styles.fca152ce.css" as="style"><link rel="preload" href="/assets/js/app.28715422.js" as="script"><link rel="preload" href="/assets/js/5.cdfc0b9f.js" as="script"><link rel="preload" href="/assets/js/20.b22f54d0.js" as="script"><link rel="preload" href="/assets/js/9.4c44b987.js" as="script"><link rel="prefetch" href="/assets/js/10.84acbb53.js"><link rel="prefetch" href="/assets/js/11.702efeb3.js"><link rel="prefetch" href="/assets/js/12.589fb250.js"><link rel="prefetch" href="/assets/js/13.5b7e8614.js"><link rel="prefetch" href="/assets/js/14.a954bfd1.js"><link rel="prefetch" href="/assets/js/15.bd11c63a.js"><link rel="prefetch" href="/assets/js/16.b4fb7988.js"><link rel="prefetch" href="/assets/js/17.61d84266.js"><link rel="prefetch" href="/assets/js/18.24a2bff9.js"><link rel="prefetch" href="/assets/js/19.43d31d8f.js"><link rel="prefetch" href="/assets/js/21.9c07bc91.js"><link rel="prefetch" href="/assets/js/22.32e1eb60.js"><link rel="prefetch" href="/assets/js/23.093427d3.js"><link rel="prefetch" href="/assets/js/24.e648d309.js"><link rel="prefetch" href="/assets/js/25.d7282ca4.js"><link rel="prefetch" href="/assets/js/26.35acf93d.js"><link rel="prefetch" href="/assets/js/27.56ca4ce1.js"><link rel="prefetch" href="/assets/js/28.93379c82.js"><link rel="prefetch" href="/assets/js/29.51d63262.js"><link rel="prefetch" href="/assets/js/30.1b336946.js"><link rel="prefetch" href="/assets/js/31.e297de45.js"><link rel="prefetch" href="/assets/js/32.4bae9555.js"><link rel="prefetch" href="/assets/js/33.4239fd2e.js"><link rel="prefetch" href="/assets/js/34.bbc16b3c.js"><link rel="prefetch" href="/assets/js/35.f16977ac.js"><link rel="prefetch" href="/assets/js/36.6141cdc8.js"><link rel="prefetch" href="/assets/js/37.43f5a7f6.js"><link rel="prefetch" href="/assets/js/38.01c53507.js"><link rel="prefetch" href="/assets/js/39.21f63708.js"><link rel="prefetch" href="/assets/js/40.f9f38954.js"><link rel="prefetch" href="/assets/js/41.0175e1f4.js"><link rel="prefetch" href="/assets/js/42.422cba18.js"><link rel="prefetch" href="/assets/js/43.3d77a131.js"><link rel="prefetch" href="/assets/js/44.aab84de2.js"><link rel="prefetch" href="/assets/js/45.ac7ca1c5.js"><link rel="prefetch" href="/assets/js/46.9982952d.js"><link rel="prefetch" href="/assets/js/47.d4c85adf.js"><link rel="prefetch" href="/assets/js/48.d00a7fe9.js"><link rel="prefetch" href="/assets/js/49.03487062.js"><link rel="prefetch" href="/assets/js/50.bbfd00cd.js"><link rel="prefetch" href="/assets/js/51.1ef38ba0.js"><link rel="prefetch" href="/assets/js/52.f352c22a.js"><link rel="prefetch" href="/assets/js/53.fa377a7b.js"><link rel="prefetch" href="/assets/js/54.16d81c63.js"><link rel="prefetch" href="/assets/js/55.b2e1b9f2.js"><link rel="prefetch" href="/assets/js/56.99f69695.js"><link rel="prefetch" href="/assets/js/57.54be906e.js"><link rel="prefetch" href="/assets/js/58.e28944e4.js"><link rel="prefetch" href="/assets/js/59.647fcd7b.js"><link rel="prefetch" href="/assets/js/6.8f67e34e.js"><link rel="prefetch" href="/assets/js/60.ed875cf2.js"><link rel="prefetch" href="/assets/js/61.d244e754.js"><link rel="prefetch" href="/assets/js/62.82572383.js"><link rel="prefetch" href="/assets/js/63.afac6e14.js"><link rel="prefetch" href="/assets/js/64.1793ed0c.js"><link rel="prefetch" href="/assets/js/65.75847d31.js"><link rel="prefetch" href="/assets/js/66.a613f673.js"><link rel="prefetch" href="/assets/js/67.374e7e54.js"><link rel="prefetch" href="/assets/js/7.2df5fd3a.js"><link rel="prefetch" href="/assets/js/8.79c44677.js"><link rel="prefetch" href="/assets/js/vendors~docsearch.b3708bf9.js"><link rel="prefetch" href="/assets/js/vendors~flowchart.3b4fa92d.js"><link rel="prefetch" href="/assets/js/vendors~notification.11c6c6d5.js">
    <link rel="stylesheet" href="/assets/css/0.styles.fca152ce.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">赵小云学习笔记</span></a> <div class="links"><form id="search-form" role="search" class="algolia-search-wrapper search-box"><input id="algolia-search-input" class="search-query"></form> <nav class="nav-links can-hide"><div class="nav-item"><a href="/notes/" class="nav-link">
  notes
</a></div><div class="nav-item"><a href="/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/config/" class="nav-link">
  配置
</a></div><div class="nav-item"><a href="/plugin/" class="nav-link">
  插件
</a></div><div class="nav-item"><a href="/theme/" class="nav-link">
  主题
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          API
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/api/cli.html" class="nav-link">
  CLI
</a></li><li class="dropdown-subitem"><a href="/zh/api/node.html" class="nav-link">
  Node
</a></li></ul></li><li class="dropdown-item"><h4>
          开发指南
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/local-development.html" class="nav-link">
  本地开发
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/design-concepts.html" class="nav-link">
  设计理念
</a></li><li class="dropdown-subitem"><a href="/zh/faq/" class="nav-link">
  FAQ
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/glossary.html" class="nav-link">
  术语
</a></li></ul></li><li class="dropdown-item"><h4>
          其他
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/migration-guide.html" class="nav-link">
  从 0.x 迁移
</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/vuejs/vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/notes/" class="nav-link">
  notes
</a></div><div class="nav-item"><a href="/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/config/" class="nav-link">
  配置
</a></div><div class="nav-item"><a href="/plugin/" class="nav-link">
  插件
</a></div><div class="nav-item"><a href="/theme/" class="nav-link">
  主题
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          API
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/api/cli.html" class="nav-link">
  CLI
</a></li><li class="dropdown-subitem"><a href="/zh/api/node.html" class="nav-link">
  Node
</a></li></ul></li><li class="dropdown-item"><h4>
          开发指南
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/local-development.html" class="nav-link">
  本地开发
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/design-concepts.html" class="nav-link">
  设计理念
</a></li><li class="dropdown-subitem"><a href="/zh/faq/" class="nav-link">
  FAQ
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/glossary.html" class="nav-link">
  术语
</a></li></ul></li><li class="dropdown-item"><h4>
          其他
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/migration-guide.html" class="nav-link">
  从 0.x 迁移
</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/vuejs/vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><a href="/api/cli.html" aria-current="page" class="active sidebar-link">命令行接口</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/api/cli.html#基本用法" class="sidebar-link">基本用法</a></li><li class="sidebar-sub-header"><a href="/api/cli.html#build" class="sidebar-link">build</a></li><li class="sidebar-sub-header"><a href="/api/cli.html#dev" class="sidebar-link">dev</a></li><li class="sidebar-sub-header"><a href="/api/cli.html#eject" class="sidebar-link">eject</a></li><li class="sidebar-sub-header"><a href="/api/cli.html#更多指令" class="sidebar-link">更多指令</a></li></ul></li><li><a href="/api/node.html" class="sidebar-link">Node.js API</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="命令行接口"><a href="#命令行接口" class="header-anchor">#</a> 命令行接口</h1> <h2 id="基本用法"><a href="#基本用法" class="header-anchor">#</a> 基本用法</h2> <div class="language-bash extra-class"><pre class="language-bash"><code>vuepress <span class="token operator">&lt;</span>command<span class="token operator">&gt;</span> targetDir <span class="token punctuation">[</span>options<span class="token punctuation">]</span>
</code></pre></div><h2 id="build"><a href="#build" class="header-anchor">#</a> build</h2> <p>在指定的目录生成一个静态站点。</p> <h3 id="p-port-port"><a href="#p-port-port" class="header-anchor">#</a> -p, --port <code>&lt;port&gt;</code></h3> <p>查看 <a href="/config/#port">port</a>。</p> <h3 id="t-temp-temp"><a href="#t-temp-temp" class="header-anchor">#</a> -t, --temp <code>&lt;temp&gt;</code></h3> <p>查看 <a href="/config/#temp">temp</a>。</p> <h3 id="c-cache-cache"><a href="#c-cache-cache" class="header-anchor">#</a> -c, --cache <code>[cache]</code></h3> <h3 id="no-cache"><a href="#no-cache" class="header-anchor">#</a> --no-cache</h3> <p>查看 <a href="/config/#cache">cache</a>。</p> <h3 id="dest-dest"><a href="#dest-dest" class="header-anchor">#</a> --dest <code>&lt;dest&gt;</code></h3> <p>查看 <a href="/config/#dest">dest</a>。</p> <h3 id="debug"><a href="#debug" class="header-anchor">#</a> --debug</h3> <p>以调试模式启动开发服务器。</p> <h3 id="silent"><a href="#silent" class="header-anchor">#</a> --silent</h3> <p>以安静模式启动开发服务器。</p> <h2 id="dev"><a href="#dev" class="header-anchor">#</a> dev</h2> <p>启动一个开发服务器。来自 <code>vuepress build</code> 的所有选项都可用。除此以外，还有几个专门针对 dev 的选项：</p> <h3 id="host-host"><a href="#host-host" class="header-anchor">#</a> --host <code>&lt;host&gt;</code></h3> <p>查看 <a href="/config/#host">host</a>。</p> <h3 id="open"><a href="#open" class="header-anchor">#</a> --open</h3> <p>当服务端准备就绪时自动打开浏览器。</p> <h3 id="no-clear-screen"><a href="#no-clear-screen" class="header-anchor">#</a> --no-clear-screen</h3> <p>当 dev server 就绪时不清除屏幕。请注意 dev server 不会在调试模式下清除屏幕。</p> <h2 id="eject"><a href="#eject" class="header-anchor">#</a> eject</h2> <p>将默认主题复制到 <code>.vuepress/theme</code> 目录，以供自定义。</p> <h2 id="更多指令"><a href="#更多指令" class="header-anchor">#</a> 更多指令</h2> <p>你可以使用 <a href="/plugin/option-api.html#extendcli">extendCli</a> 来创建自定义命令。</p></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/vuejs/vuepress/edit/master/packages/docs/docs/api/cli.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2021/1/23 下午1:08:04</span></div></footer> <div class="page-nav"><p class="inner"><!----> <span class="next"><a href="/api/node.html">
        Node.js API
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----><!----></div></div>
    <script src="/assets/js/app.28715422.js" defer></script><script src="/assets/js/5.cdfc0b9f.js" defer></script><script src="/assets/js/20.b22f54d0.js" defer></script><script src="/assets/js/9.4c44b987.js" defer></script>
  </body>
</html>
